import { http, HttpResponse } from 'msw'
import Mock from 'mockjs'
// 新建标签组
export const createTagGroup = http.get('/data/ed/tag/createGroup', () => {
  return HttpResponse.json({
    success: true,
    errorCode: '',
    errorMessage: '',
  })
})
// 新建标签
export const createTag = http.get('/data/ed/tag/createTag', () => {
  return HttpResponse.json({
    success: true,
    errorCode: '',
    errorMessage: '',
  })
})
// 拖拽排序/分组
export const updateOrder = http.get('/data/ed/tag/updateOrder', () => {
  return HttpResponse.json({
    success: true,
    errorCode: '',
    errorMessage: '',
  })
})
// 批量发布标签
export const batchPublish = http.post('/data/ed/tag/batchPublish', () => {
  return HttpResponse.json({
    success: true,
    errorCode: '',
    errorMessage: '',
  })
})
// 获取标签列表
export const tagList = http.get('/data/ed/tag/list', () => {
  let taglist = [
    {
      tagName: '标签组1',
      type: 0,
      tagId: '1',
      orderBy: 1,
      isPublished: 0,
      children: [
        {
          tagName: '标签1-1',
          type: 1,
          tagId: '11',
          orderBy: 2,
          isPublished: 0,
        },
        {
          tagName: '标签1-2',
          type: 1,
          tagId: '12',
          orderBy: 3,
          isPublished: 0,
        },
        {
          tagName: '标签1-3',
          type: 1,
          tagId: '13',
          orderBy: 4,
          isPublished: 0,
        },
      ],
    },
    {
      tagName: '标签组2',
      type: 0,
      tagId: '2',
      orderBy: 5,
      isPublished: 1,
      children: [
        {
          tagName: '标签2-1',
          type: 1,
          tagId: '21',
          orderBy: 6,
          isPublished: 1,
        },
        {
          tagName: '标签2-2',
          type: 1,
          tagId: '22',
          orderBy: 7,
          isPublished: 1,
        },
        {
          tagName: '标签2-3',
          type: 1,
          tagId: '23',
          orderBy: 8,
          isPublished: 1,
        },
      ],
    },
    {
      tagName: '标签组3',
      type: 0,
      tagId: '3',
      orderBy: 33,
      isPublished: 0,
      children: [
        {
          tagName: '标签3-1',
          type: 1,
          tagId: '31',
          orderBy: 34,
          isPublished: 0,
        },
        {
          tagName: '标签3-2',
          type: 1,
          tagId: '32',
          orderBy: 35,
          isPublished: 0,
        },
        {
          tagName: '标签3-3',
          type: 1,
          tagId: '33',
          orderBy: 36,
          isPublished: 0,
        },
      ],
    },
  ]
  return HttpResponse.json({
    success: true,
    errorCode: '',
    errorMessage: '',
    data: taglist,
  })
})
// 删除标签组/标签
export const deleteTag = http.get('/data/ed/tag/delete', () => {
  return HttpResponse.json({
    success: true,
    errorCode: '',
    errorMessage: '',
  })
})
// 更新标签组/标签名称
export const updateTag = http.get('/data/ed/tag/updateTag', () => {
  return HttpResponse.json({
    success: true,
    errorCode: '',
    errorMessage: '',
  })
})
